/* Copyright ©, 2023, ECARX (Hubei) Technology Co., Ltd. All rights reserved.
 *
 * NOTICE: This file contains information which is confidential and proprietary to ECARX
 * (Hubei) Technology Co., Ltd. and/or other developers. No license to any intellectual
 * property rights contained within this file is either granted or implied except as may be
 * provided in an agreement with ECARX (Hubei) Technology Co., Ltd.
 *
 * Any unauthorized copying or distribution of content from this file in whole or in part
 * is prohibited.
 */
#pragma once

#include "PKIHal.h"
#include "hidl/HidlSupport.h"
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <vendor/ecarx/xma/pki/1.0/IPKI.h>

namespace vendor::ecarx::xma::pki::V1_0::implementation {

using namespace ::android::hardware;

struct PKIHALManager : public V1_0::IPKI {

  PKIHALManager(PKIHal *pkiHal);
  Return<void> readCertification(readCertification_cb _hidl_cb) override;
  Return<void> readSWK3Certificate(const hidl_string& filename, readSWK3Certificate_cb _hidl_cb) override;
  Return<StatusCode> updatePKIInstallStatus(PKIInstallPlatform clientId,InstallStatus status) override;
  Return<void> getSecurityInfoChecksum(getSecurityInfoChecksum_cb _hidl_cb) override;
  Return<StatusCode> writeBlock(int32_t offset, const hidl_vec<int8_t>& value) override;
  
private:
  PKIHal *mPKIHal;
};
} // namespace vendor::ecarx::xma::pki::implementation